home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group03a.txt / 000062_icon-group-sender_Fri Mar 28 08:11:36 2003.msg < prev    next >
Internet Message Format  |  2003-12-22  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2SFBUU16993
  4.     for icon-group-addresses; Fri, 28 Mar 2003 08:11:30 -0700 (MST)
  5. Message-Id: <200303281511.h2SFBUU16993@baskerville.CS.Arizona.EDU>
  6. X-Sender: whm@mail.mse.com (Unverified)
  7. Date: Thu, 27 Mar 2003 23:00:04 -0700
  8. To: icon-group@cs.arizona.edu
  9. From: "William H. Mitchell" <whm86@mse.com>
  10. Subject: Currying and partial evaluation
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13.  
  14. Speaking of currying and partial evaluation, I've been thinking about a
  15. simple addition to Icon that would provide enough footing to do that sort
  16. of stuff.
  17.  
  18. The expression expr1(expr2,...) currently has meaning if expr1 yields a
  19. procedure, string, or integer.  I'd like to see that expanded to have
  20. meaning if expr1 is a list.
  21.  
  22. Example:
  23.  
  24.   p(1,2)
  25.  
  26. could be expressed as
  27.  
  28.   [p](1,2)
  29.  
  30. or
  31.  
  32.   [p,1](2)
  33.  
  34. or
  35.  
  36.   [p,1,2]()
  37.  
  38. With that in hand you might then say
  39.  
  40.   pL := [push,L]
  41.  
  42. and then
  43.  
  44.   every pL(1 to 10)
  45.  
  46.  
  47. A higher-order function might return a list, but the user would need to
  48. take no special steps to use it.
  49.  
  50. I haven't thought through what L(p) would mean if L[1] is a list... :)  
  51.